<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <meta name="viewport"
            content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>vue_wxkf</title>
      <style>
          #app{
              height: 100%;
          }
          @font-face {
              font-family: 'iconfont-vuem';
              src: url('//at.alicdn.com/t/font_1472697628_3911114.eot');
              /* IE9*/
              src: url('//at.alicdn.com/t/font_1472697628_3911114.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('//at.alicdn.com/t/font_1472697628_3911114.woff') format('woff'), /* chrome、firefox */ url('//at.alicdn.com/t/font_1472697628_3911114.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('//at.alicdn.com/t/font_1472697628_3911114.svg#iconfont-vuem') format('svg');
              /* iOS 4.1- */
          }
      </style>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
  <script>
      <?php
          $lifetime = 300;    //5分钟
      session_set_cookie_params($lifetime);
      session_start();

      if(isset($_SESSION['jsApiParameters'])){
          $jsApiParameters = json_decode($_SESSION['jsApiParameters'],true);
          if((time() - $jsApiParameters['timeStamp']) > 5){
              session_unset();

          }
      }


      //①、获取用户openid
      if(!isset($_SESSION['openId'])){
          ini_set('date.timezone','Asia/Shanghai');
//error_reporting(E_ERROR);

          require_once "../lib/WxPay.Api.php";
          require_once "WxPay.JsApiPay.php";
          require_once 'log.php';
          $tools = new JsApiPay();
          $openId = $tools->GetOpenid();
          $_SESSION['openId'] = $openId;

      }else{
          $openId = $_SESSION['openId'];
      }
          ?>
      sessionStorage['openId']=<?php
          echo "'".$openId."'";
          ?>
  </script>
  <script src="static/js/jquery-1.11.0.min.js"></script>
  <script src="static/js/font-size.js"></script>
  <script src="static/js/jquery.charfirst.pinyin.js"></script>
  <!--<script src="static/js/sort.js"></script>-->
</html>
